package com.linln.modules.service.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.linln.modules.service.repository.ServiceMapper;
import com.linln.modules.service.service.ServiceService;
import com.linln.modules.service.domain.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * @author : pengliang
 * @version V1.0
 * @Project: timo
 * @Package com.linln.modules.service.service.impl
 * @Descriptio /**
 * @Project: timo
 * @Package com.linln.modules.service.service.impl
 * @Description: TODO
 * @date Date : 2020年12月14日 15:27
 */

@org.springframework.stereotype.Service
public class ServiceServiceImpl extends ServiceImpl<ServiceMapper, Service> implements ServiceService {

    @Autowired
    private ServiceMapper serviceMapper;
    @Override
    public Map<String, Object> getIntegralMallService(Integer pageNum, Integer limit) {
        PageHelper.startPage(pageNum,limit);
        Map<String,Object> map = new HashMap<>();
        PageInfo<Service> pageInfo = new PageInfo<>(serviceMapper.getIntegralMallService());
        map.put("code",200);
        map.put("data",pageInfo.getList());
        map.put("count",pageInfo.getTotal());
        return map;
    }
}



